using System;
using System.Reflection;
using System.Collections.Generic;

using DevExpress.ExpressApp;
using DevExpress.Persistent.BaseImpl;
using DevExpress.Xpo.Metadata;
using DevExpress.Xpo;
using System.Configuration;
using DevExpress.ExpressApp.ConditionalAppearance;
using DevExpress.ExpressApp.Kpi;
using DevExpress.ExpressApp.ViewVariantsModule;
using DevExpress.ExpressApp.Updating;

namespace DomainComponents.XCRM {
	public sealed partial class DomainComponentsXCRMModule : ModuleBase {
		public DomainComponentsXCRMModule() {
			InitializeComponent();
            RequiredModuleTypes.Add(typeof(DomainComponents.Common.DomainComponentsCommonModule));
            RequiredModuleTypes.Add(typeof(ConditionalAppearanceModule));
            RequiredModuleTypes.Add(typeof(ViewVariantsModule));
            RequiredModuleTypes.Add(typeof(KpiModule));
		}

        public override void Setup(XafApplication application) {
            base.Setup(application);
        }

        protected override IEnumerable<Type> GetDeclaredExportedTypes() {
            List<Type> declaredExportedTypes = new List<Type>(base.GetDeclaredExportedTypes());
            declaredExportedTypes.AddRange(KpiModule.GetKpiBusinessClasses());
            return declaredExportedTypes;
        }
        public override IEnumerable<ModuleUpdater> GetModuleUpdaters(IObjectSpace objectSpace, Version versionFromDB) {
            ModuleUpdater updater = new Updater(objectSpace, versionFromDB);
            return new ModuleUpdater[] { updater };
        }
    }
}
